<!DOCTYPE html>
<!-- 
Template Name: Metronic - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.0
Version: 1.5
Author: KeenThemes
Website: http://www.keenthemes.com/
Purchase: http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes
-->
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
   <meta charset="utf-8" />
   <title>利导科技客户关系管理系统  | 新建服务</title>
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
   <meta content="width=device-width, initial-scale=1.0" name="viewport" />
   <meta content="" name="description" />
   <meta content="" name="author" />
   <meta name="MobileOptimized" content="320">
   <!-- BEGIN GLOBAL MANDATORY STYLES -->          
   <link href="${base}/assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
   <link href="${base}/assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
   <link href="${base}/assets/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css"/>
   <!-- END GLOBAL MANDATORY STYLES -->
   <!-- BEGIN PAGE LEVEL STYLES -->
    <!-- BEGIN PAGE LEVEL STYLES -->
   <link rel="stylesheet" type="text/css" href="${base}/assets/plugins/bootstrap-fileupload/bootstrap-fileupload.css" />
   <link rel="stylesheet" type="text/css" href="${base}/assets/plugins/gritter/css/jquery.gritter.css" />
   <link rel="stylesheet" type="text/css" href="${base}/assets/plugins/select2/select2_metro.css" />
   <link rel="stylesheet" type="text/css" href="${base}/assets/plugins/clockface/css/clockface.css" />
   <link rel="stylesheet" type="text/css" href="${base}/assets/plugins/bootstrap-wysihtml5/bootstrap-wysihtml5.css" />
   <link rel="stylesheet" type="text/css" href="${base}/assets/plugins/bootstrap-datepicker/css/datepicker.css" />
   <link rel="stylesheet" type="text/css" href="${base}/assets/plugins/bootstrap-timepicker/compiled/timepicker.css" />
   <link rel="stylesheet" type="text/css" href="${base}/assets/plugins/bootstrap-colorpicker/css/colorpicker.css" />
   <link rel="stylesheet" type="text/css" href="${base}/assets/plugins/bootstrap-daterangepicker/daterangepicker-bs3.css" />
   <link rel="stylesheet" type="text/css" href="${base}/assets/plugins/bootstrap-datetimepicker/css/datetimepicker.css" />
   <link rel="stylesheet" type="text/css" href="${base}/assets/plugins/jquery-multi-select/css/multi-select.css" />
   <link href="${base}/assets/plugins/bootstrap-switch/static/stylesheets/bootstrap-switch-metro.css" rel="stylesheet" type="text/css"/>
   <link rel="stylesheet" type="text/css" href="${base}/assets/plugins/jquery-tags-input/jquery.tagsinput.css" />
   <!-- END PAGE LEVEL STYLES -->
   <!-- BEGIN THEME STYLES --> 
   <link href="${base}/assets/css/style-metronic.css" rel="stylesheet" type="text/css"/>
   <link href="${base}/assets/css/style.css" rel="stylesheet" type="text/css"/>
   <link href="${base}/assets/css/style-responsive.css" rel="stylesheet" type="text/css"/>
   <link href="${base}/assets/css/plugins.css" rel="stylesheet" type="text/css"/>
   <link href="${base}/assets/css/themes/default.css" rel="stylesheet" type="text/css" id="style_color"/>
   <link href="${base}/assets/css/custom.css" rel="stylesheet" type="text/css"/>
   <!-- END THEME STYLES -->
   <link rel="shortcut icon" href="${base}/assets/img/favicon.ico" />
</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->
<body class="page-header-fixed">
	<#include "header.ftl">
   <div class="clearfix"></div>
   <!-- BEGIN CONTAINER -->
   <div class="page-container">
      <!-- BEGIN SIDEBAR -->
      <#include "main_menu.ftl">
      <!-- END SIDEBAR -->
      <!-- BEGIN PAGE -->
      <div class="page-content">
      	 <#include "changePassword.ftl">
         <#include "system-set.ftl">
         <!-- BEGIN PAGE HEADER-->
		 <div class="row">
			<div class="col-md-12">
			   <!-- BEGIN PAGE TITLE & BREADCRUMB-->
			   <h3 class="page-title">
			   Edit Service<small>,  编辑某个服务.</small>
			   </h3>
			   <ul class="page-breadcrumb breadcrumb">
			      <li>
			         <i class="icon-home"></i>
			         <a href="${base}/admin/admin!main.action">Home</a> 
			         <i class="icon-angle-right"></i>
			      </li>
			      <li>
			         <a href="#">Customer Management</a>
			         <i class="icon-angle-right"></i>
			      </li>
			      <li>
			      	<a href="${base}/admin/customer!myCustomer.action">Service bills</a>
			      	<i class="icon-angle-right"></i>
			      </li>
			      <li>
			      	<a href="#">Edit Service</a>
			      </li>
			   </ul>
			   <!-- END PAGE TITLE & BREADCRUMB-->
			</div>
		 </div>
		 <!-- END PAGE HEADER-->
		<!-- BEGIN PAGE CONTENT-->
		<div class="row">
			<div class="col-md-12">
               <!-- BEGIN VALIDATION STATES-->
               <div class="portlet box blue">
                  <div class="portlet-title">
                     <div class="caption"><i class="icon-reorder"></i>Service Information</div>
                     <div class="tools">
                        <a href="javascript:;" class="collapse"></a>
                        <a href="#portlet-config" data-toggle="modal" class="config"></a>
                        <a href="javascript:;" class="reload"></a>
                        <a href="javascript:;" class="remove"></a>
                     </div>
                  </div>
                  <div class="portlet-body form">
                     <!-- BEGIN FORM-->
                     <form action="${base}/admin/customer!save.action" id="form_service" class="form-horizontal">
                        <div class="form-body">
                        	<h3 class="form-section">业务人员必须提供的信息</h3>
                           <div class="alert alert-danger display-hide">
                              <button class="close" data-dismiss="alert"></button>
                              You have some form errors. Please check below.
                           </div>
                           <div class="alert alert-success display-hide">
                              <button class="close" data-dismiss="alert"></button>
                              Your form validation is successful!
                           </div>
                           <input type = "hidden" value = "${service.id}" id = "serviceId">
                           <div class="row">
                               <div class="col-md-6">
                                  <div class="form-group">
                                     <label class="control-label col-md-3">服务客户<span class="required">*</span></label>
                                     <div class="col-md-9">
                                        <select class="form-control" name = "customerName" id = "customerName">
                                           <option value=""></option>
                                           <#if customerList?has_content>
                                           	<#list customerList as customer>
                                           		<option <#if customer.id == service.customer.id>selected = "selected"</#if>value="${customer.id}">${customer.fullname}</option>
                                           	</#list>
                                           </#if>
                                        </select>
                                     </div>
                                  </div>
                               </div>
                               <!--/span-->
                               <div class="col-md-6">
                                  <div class="form-group">
                                     <label class="control-label col-md-3">联系人<span class="required">*</span></label>
                                     <div class="col-md-9">
                                        <select class="form-control" name = "contactsName" id = "contactsName">
                                           <#if service.contacts.id?has_content>
                                           	<option selected = "selected" value="${service.contacts.id}">${service.contacts.name}</option>
                                           <#else>
                                           	<option selected = "selected" value=""></option>
                                           </#if>
                                        </select>
                                     </div>
                                  </div>
                               </div>
                               <!--/span-->
                            </div>
                           <!--/row-->
                            <div class="row">
                               <div class="col-md-6">
                                  <div class="form-group">
                                     <label class="control-label col-md-3">客户需求及性格</label>
                                     <div class="col-md-9">
                                        <textarea cols = "55" rows = "4" name = "requirements" id = "requirements" placeholder="客户需求及性格"><#if service.requirements?has_content>${service.requirements}</#if></textarea>
                                     </div>
                                  </div>
                               </div>
                               <!--/span-->
                               <div class="col-md-6">
                                  <div class="form-group">
                                     <label class="control-label col-md-3">指定服务人</label>
                                     <div class="col-md-9">
                                        <select class="form-control" name = "servicer" id = "servicer" >
                                           <option value=""></option>
                                           <#if employeeList?has_content>
                                           	<#list employeeList as employee>
                                           		<option <#if service.servicer==employee.fullname>selected = "selected"</#if> value="${employee.fullname}">${employee.fullname}</option>
                                           	</#list>
                                           </#if>
                                        </select>
                                     </div>
                                  </div>
                               </div>
                               <!--/span-->
                            </div>
                            <!--/row-->
                            <h3 class="form-section">技术人员必须反馈的信息</h3>
                            <!--/row-->
                            <div class="row">
                               <div class="col-md-6">
                                  <div class="form-group">
                                     <label class="control-label col-md-3">不能满足的需求</label>
                                     <div class="col-md-9">
                                        <textarea cols = "55" rows = "4" name = "cannotSatisfyOfRequirements" id = "cannotSatisfyOfRequirements" placeholder="不能满足的需求"><#if service.cannotSatisfyOfRequirements?has_content>${service.cannotSatisfyOfRequirements}</#if></textarea>
                                     </div>
                                  </div>
                               </div>
                               <!--/span-->
                               <div class="col-md-6">
                                  <div class="form-group">
                                     <label class="control-label col-md-3">服务方式<span class="required">*</span></label>
                                     <div class="col-md-9">
                                        <select class="form-control" name = "serviceMode" id = "serviceMode">
                                           <option <#if service.serviceMode == "">selected = "selected"</#if> value=""></option>
                                           <option <#if service.serviceMode == "电话">selected = "selected"</#if> value="电话">电话</option>
                                           <option <#if service.serviceMode == "QQ协助">selected = "selected"</#if> value="QQ协助">QQ协助</option>
                                           <option <#if service.serviceMode == "远程协助">selected = "selected"</#if> value="远程协助">远程协助</option>
                                        </select>
                                     </div>
                                  </div>
                               </div>
                            </div>
                            <div class="row">
                               <div class="col-md-6">
                                  <div class="form-group">
                                     <label class="control-label col-md-3">感兴趣的功能</label>
                                     <div class="col-md-9">
                                        <textarea cols = "55" rows = "4" name = "featuresOfInterest" id = "featuresOfInterest" placeholder="感兴趣的功能"><#if service.featuresOfInterest?has_content>${service.featuresOfInterest}</#if></textarea>
                                     </div>
                                  </div>
                               </div>
                               <div class="col-md-6">
                                  <div class="form-group">
                                     <label class="control-label col-md-3">培训系统类型</label>
                                     <div class="col-md-9">
                                        <select class="form-control" name = "systemType" id = "systemType" >
                                           <option <#if service.systemType == "">selected = "selected"</#if> value=""></option>
                                           <option <#if service.systemType == "高级版">selected = "selected"</#if> value="高级版">高级版</option>
                                           <option <#if service.systemType == "专业版">selected = "selected"</#if> value="专业版">专业版</option>
                                           <option <#if service.systemType == "标准版">selected = "selected"</#if> value="标准版">标准版</option>
                                           <option <#if service.systemType == "大众版">selected = "selected"</#if> value="大众版">大众版</option>
                                        </select>
                                     </div>
                                  </div>
                               </div>
                            </div>
                            <div class="row">
                               <div class="col-md-6">
                                  <div class="form-group">
                                     <label class="control-label col-md-3">服务详情</label>
                                     <div class="col-md-9">
                                        <textarea cols = "55" rows = "4" name = "serviceDetail" id = "serviceDetail" placeholder="服务详情"><#if service.serviceDetail?has_content>${service.serviceDetail}</#if></textarea>
                                     </div>
                                  </div>
                               </div>
                               <!--/span-->
                               <div class="col-md-6">
                                  <div class="form-group">
                                     <label class="control-label col-md-3">下步安排</label>
                                     <div class="col-md-9">
                                        <textarea cols = "55" rows = "4" name = "nextPlan" id = "nextPlan" placeholder="下步安排"><#if service.nextPlan?has_content>${service.nextPlan}</#if></textarea>
                                     </div>
                                  </div>
                               </div>
                            </div>
                            <div class="row">
                               <!--/span-->
                               <div class="col-md-6">
                                  <div class="form-group">
                                     <label class="control-label col-md-3">创建人</label>
                                     <div class="col-md-9">
                                        <input type="text" class="form-control" name = "creater" id = "creater" readonly <#if service.creater?has_content> value = "${service.creater}" </#if>  />
                                     </div>
                                  </div>
                               </div>
                               <div class="col-md-6">
                                  <div class="form-group">
                                     <label class="control-label col-md-3">创建时间</label>
                                     <div class="col-md-9">
                                        <input type="text" class="form-control" name = "createTime"  id = "createTime" readonly<#if service.createTime?has_content> value = "${service.createTime}" </#if>  />
                                     </div>
                                  </div>
                               </div>
                               <!--/span-->
                            </div>
                            <!--/row-->
                            <div class="row">
                               <!--/span-->
                               <div class="col-md-6">
                                  <div class="form-group">
                                     <label class="control-label col-md-3">状态</label>
                                     <div class="col-md-9">
                                       <select class="form-control" name = "status" id = "status" >
                                           <option <#if service.status == "">selected = "selected"</#if> value=""></option>
                                           <option <#if service.status == "未完成">selected = "selected"</#if> value="未完成">未完成</option>
                                           <option <#if service.status == "完成">selected = "selected"</#if> value="完成">完成</option>
                                        </select>
                                     </div>
                                  </div>
                               </div>
                               <!--/span-->
                               <div class="col-md-6">
                                  <div class="form-group">
                                     <label class="control-label col-md-3">服务时长</label>
                                     <div class="col-md-9">
                                        <input <#if service.serviceDuration?has_content> value = "${service.serviceDuration}" </#if> type="text" class="form-control" name = "serviceDuration"  id = "serviceDuration" placeholder="服务时长(mins)">
                                     </div>
                                  </div>
                               </div>
                            </div>
                            <!--/row-->        
                            <div class="row">
                               <!--/span-->
                               <div class="col-md-6">
                                  <div class="form-group">
                                     <label class="control-label col-md-3">服务完成时间</label>
                                     <div class="col-md-9">
                                        <input type="text" class="form-control" name = "finishTime"  id = "finishTime" readonly <#if service.finishTime?has_content> value = "${service.finishTime}" </#if>>
                                     </div>
                                  </div>
                               </div>
                            </div>
                        <div class="form-actions fluid">
                           <div class="col-md-offset-3 col-md-9">
                              <button type="submit" class="btn green"><i class="icon-ok"></i>Submit</button>
                              <button type="button" class="btn default"><i class="icon-remove"></i>Cancel</button>                              
                           </div>
                        </div>
                     </form>
                     <!-- END FORM-->
                  </div>
               </div>
               <!-- END VALIDATION STATES-->
            </div>
         </div>   
         <!-- END PAGE CONTENT-->
      </div>
      <!-- END PAGE -->	 
	</div>
	<!-- END CONTAINER -->
	<!-- BEGIN FOOTER -->
   <#include "footer.ftl">
   <!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
   <#include "coreJsPlugins.ftl">
   <!-- BEGIN PAGE LEVEL PLUGINS -->
   <script type="text/javascript" src="${base}/assets/plugins/jquery-validation/dist/jquery.validate.min.js"></script>
   <script type="text/javascript" src="${base}/assets/plugins/jquery-validation/dist/additional-methods.min.js"></script>
   <script type="text/javascript" src="${base}/assets/plugins/select2/select2.min.js"></script>
   <script type="text/javascript" src="${base}/assets/plugins/bootstrap-wysihtml5/wysihtml5-0.3.0.js"></script> 
   <script type="text/javascript" src="${base}/assets/plugins/bootstrap-wysihtml5/bootstrap-wysihtml5.js"></script>
   <script type="text/javascript" src="${base}/assets/plugins/ckeditor/ckeditor.js"></script>
   <script type="text/javascript" src="${base}/assets/plugins/fuelux/js/spinner.min.js"></script>
   <script type="text/javascript" src="${base}/assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
   <script type="text/javascript" src="${base}/assets/plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"></script>
   <script type="text/javascript" src="${base}/assets/plugins/clockface/js/clockface.js"></script>
   <script type="text/javascript" src="${base}/assets/plugins/bootstrap-daterangepicker/moment.min.js"></script>
   <script type="text/javascript" src="${base}/assets/plugins/bootstrap-daterangepicker/daterangepicker.js"></script> 
   <script type="text/javascript" src="${base}/assets/plugins/bootstrap-colorpicker/js/bootstrap-colorpicker.js"></script>  
   <script type="text/javascript" src="${base}/assets/plugins/bootstrap-timepicker/js/bootstrap-timepicker.js"></script>
   <script type="text/javascript" src="${base}/assets/plugins/jquery-inputmask/jquery.inputmask.bundle.min.js"></script>   
   <script type="text/javascript" src="${base}/assets/plugins/jquery.input-ip-address-control-1.0.min.js"></script>
   <script type="text/javascript" src="${base}/assets/plugins/jquery-multi-select/js/jquery.multi-select.js"></script>
   <script type="text/javascript" src="${base}/assets/plugins/jquery-multi-select/js/jquery.quicksearch.js"></script>   
   <script src="${base}/assets/plugins/jquery.pwstrength.bootstrap/src/pwstrength.js" type="text/javascript" ></script>
   <script src="${base}/assets/plugins/bootstrap-switch/static/js/bootstrap-switch.min.js" type="text/javascript" ></script>
   <script src="${base}/assets/plugins/jquery-tags-input/jquery.tagsinput.min.js" type="text/javascript" ></script>
   <script type="text/javascript" src="${base}/assets/plugins/bootstrap-fileupload/bootstrap-fileupload.js"></script>
   <!-- END PAGE LEVEL PLUGINS -->
   <!-- BEGIN PAGE LEVEL STYLES -->
   <script src="${base}/assets/scripts/app.js"></script>
   <script src="${base}/resources/scripts/service-edit-validation.js"></script>
   <!-- END PAGE LEVEL STYLES -->    
   <script>
      jQuery(document).ready(function() {   
         // initiate layout and plugins
         App.init();
         ServiceValidation.init();
         /**
         	客户与联系人的联动
         */
         $("#customerName").change(function(){
         	var customerId = $(this).val();
				$.ajax({
			        type:"post",
			        url:"${base}/admin/contacts!findByCustomer.action",
			        dataType:"json",
			        data:"customerId="+customerId,
			        cache:false,
			        beforeSend:function(XMLHttpRequest){
			        },
			        success:function(json){
			        	result = json.result;
			        	if(result){
				        	contactsList = json.contactsList;
							//先清除旧数据,再添加
							$("#contactsName option").each(function(i){
			            		$(this).remove();
			            	});
							$(contactsList).each(function(i){
					            $("#contactsName").append( '<option value =  '+contactsList[i].id+' >'+contactsList[i].name+'</option>');
				    		});
			        	}else{
			        		alert("程序异常");
			        	}
			          
			        },
			       	complete:function(XMLHttpRequest,textStatus){
			       	},
			      	error:function(XMLHttpRequest,textStatus,errorThrown){
			      		alert("很抱歉,网络出错,请重试！");
			      	}
			    });
         });
      });
   </script>
   <!-- END JAVASCRIPTS -->
</body>
</html>